<?php
include '../conn.php';
include "s-cookie.php";
$sid = $_SESSION['s-id'];
$pid = $_GET['projectId'];
$sidsql = "select StudentName,StudentId,Major,Class,Tel,email  from student WHERE StudentId=$sid";
$pidsql = "select ProjectName from project WHERE ProjectId=$pid";
$sidresult = $conn->query($sidsql);
$pidresult = $conn->query($pidsql);
$sidrow = $sidresult->fetch_array();
$pidrow = $pidresult->fetch_array();
?>
<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>选课信息</title>
    <link rel="stylesheet" type="text/css" href="../css/htmleaf-demo.css">
    <link rel="stylesheet" type="text/css" href="../css/nav.css">
    <link rel="stylesheet" type="text/css" href="../fonts/iconfont.css">

    <link rel="stylesheet" href="../css/bootstrap-theme.css"/>

    <script type="text/javascript" src="../js/jquery.min.js"></script>
    <link rel="stylesheet" href="../css/bootstrap-theme.min.css"/>
    <link rel="stylesheet" href="../css/bootstrap.css"/>
    <script type="text/javascript" src="../js/bootstrap3.0.3.min.js"></script>

    <link rel="stylesheet" type="text/css" href="../css/style.css">

    <style>
        table {
            width: 50%;
        }

        td:nth-child(1) {
            width: 20%;
            text-align: center;
        }

        td:nth-child(2) {
            width: 35%;
        }

        td:nth-child(3) {
            width: 10%;
            text-align: center;
        }

        td:nth-child(4) {
            width: 35%;
        }

        input {
            border: none;
            width: 100%;
        }

        textarea {
            border: none;
            width: 100%;
        }
    </style>
    <script type="text/javascript" src="../js/jquery-1.11.0.min.js"></script>
    <script>
        function choosub(projectId) {
            var Id = projectId;
            var text = document.getElementById('mask').value;
            $.ajax({
                type: "POST",
                url: "chooseTask.php",
                data: "StduentId=<?=$sidrow[1]?>" + "&ProjectId=" + Id + "&intention=" + text + "&method=choose",
                success: function (msg) {
                    alert(msg);
                    window.location.href = "teachresearch.php";
                }
            });
        }
    </script>
</head>

<body class="bodycolor">

<nav class="navbar navbar-default navbar-fixed-top" style="clear: left;">
    <div class="container">
        <div class="navbar-right navfont" id="navbar-collapse">
            <p>华软网络技术系毕业管理系统</p>
        </div>
        <a href="s-cookie.php?cookie=out" id="out">退出</a>
    </div>

</nav>

<div class="nav topx navbackground-s" id="nav">
    <div>

        <div style="border-bottom:1px solid rgba(255,255,255,.1)"><img src="../images/mini.png"></div>
    </div>
    <ul>
        <li class="nav-item">
            <a href="s-index.php"><i class="my-icon nav-icon icon_2"></i><span>首页</span><i class="my-icon nav-more"></i></a>

        </li>
        <li class="nav-item">
            <a href="s-mykt.php"><i class="my-icon nav-icon icon_1"></i><span>我的课题</span><i
                    class="my-icon nav-more"></i></a>
        </li>

        <li class="nav-item">
            <a href="s-examination.php"><i class="my-icon nav-icon icon_3"></i><span>成绩考核表</span><i
                    class="my-icon nav-more"></i></a>

        </li>
        <li class="nav-item">
            <a href="s-information.php"><i class="my-icon nav-icon icon_4"></i><span>我的资料</span><i
                    class="my-icon nav-more"></i></a>
        </li>
        <li class="nav-item">
            <a href="teachresearch.php"><i class="my-icon nav-icon icon_6"></i><span>选课</span><i
                    class="my-icon nav-more"></i></a>
        </li>
    </ul>
</div>

<div class="indexborder">

    <div class="bannerdiv">
        <!--colspan="2"-->

        <div class="box-inline indexdiv1 panel panel-default auto" align="center">
            <center>
                <h1>选课信息</h1>

                <table border="1px">
                    <tr>
                        <td style="border: 0" colspan="4">学生填写部分:</td>

                    </tr>
                    <tr>
                        <td>姓名</td>
                        <td><input type="text" value="<?= $sidrow[0] ?>"></td>
                        <td>学号</td>
                        <td><input type="text" value="<?= $sidrow[1] ?>"></td>
                    </tr>
                    <tr>
                        <td>专业</td>
                        <td><input type="text" value="<?= $sidrow[2] ?>"></td>
                        <td>班别</td>
                        <td><input type="text" value="<?= $sidrow[3] ?>"></td>
                    </tr>
                    <tr>
                        <td>联系电话</td>
                        <td colspan="3"><input type="text" value="<?= $sidrow[4] ?>"></td>
                    </tr>
                    <tr>
                        <td>E-MAIL</td>
                        <td colspan="3"><input type="text" value="<?= $sidrow[5] ?>"></td>
                    </tr>
                    <tr>
                        <td>选题名称</td>
                        <td colspan="3"><input type="text" value="<?= $pidrow[0] ?>"></td>
                    </tr>
                    <tr>
                        <td>选课意向</td>
                        <td colspan="3"><textarea id="mask"></textarea></td>
                    </tr>
                    <tr>
                        <td style="border: 0" colspan="4">指导教师填写部分：</td>
                    </tr>
                    <tr>
                        <td>确定选题</td>
                        <td><input type="text" readonly="true" style="background-color: gray"></td>
                        <td>完成时间</td>
                        <td><input type="text" readonly="true" style="background-color: gray"></td>
                    </tr>
                    <tr>
                        <td>指导老师</td>
                        <td><input type="text" readonly="true" style="background-color: gray"></td>
                        <td>联系电话</td>
                        <td><input type="text" readonly="true" style="background-color: gray"></td>
                    </tr>
                    <tr>
                        <td><input type="button" value="提交" onclick="choosub(<?= $pid ?>)"></td>
                        <td></td>
                        <td><input type="button" value="返回" onclick="javascript:history.go(-1);"></td>
                        <td></td>
                    </tr>
                </table>
            </center>
        </div>

    </div>


</div>


<script>
    window.jQuery || document.write('<script src="../js/jquery-1.11.0.min.js"><\/script>')
</script>
<script type="text/javascript" src="../js/nav.js"></script>

</body>

</html>




























